##REPLICATION CODE FOR HOW ASIAN AMERICANS VOTED IN 2020###
##PUBLISHED IN POLITICAL BEHAVIOR

#Authors: Nathan Kar Ming Chan, Joyce Nguyen, and Natalie Masuoka

#DATASET: 2020 Collaborative Multiracial Post-Election Survey (Primary Samples Release Only)


#load packages
library(haven)
library(stargazer)
library(ggeffects)
library(sjPlot)
library(haven)
library(questionr)
library(stargazer)
library(Matching)
library(rbounds)
library(mice)
library(openxlsx)
library(rio)
library(readxl)
library(MatchIt)
library(Zelig)
library(ZeligChoice)
library(ggplot2)
library(ggpubr)
library(ggthemes)
library(readxl)
library(haven)
library(stargazer)

#read in data; The 2020 CMPS is currently embargoed to Collaborators/Contributors and their co-authors.
#PIs of the 2020 CMPS will make the CMPS available to the public sometime in 2023
#See: https://cmpsurvey.org/2020-survey/ for more information

#cmps <- read_sav("C:/Users/natha/Dropbox/CMPS 2020/CMPS 2020 primary sample weighted SPSS.sav")

#RECODE RACE AND DEMOGRAPHIC VARIABLES

table(cmps$S2_Racer4)
cmps$asian <- NA
cmps$asian <- as.numeric(cmps$asian)
cmps$asian <- ifelse(cmps$S2_Racer4==1,1,0)
table(cmps$asian)

table(cmps$S3b)
cmps$woman <- NA
cmps$woman <- as.numeric(cmps$woman)
cmps$woman <- ifelse(cmps$S3b==2,1,0)
table(cmps$woman)

table(cmps$S5_Age)
cmps$age <- NA
cmps$age <- as.numeric(cmps$age)
cmps$age[cmps$S5_Age==2] <- 0
cmps$age[cmps$S5_Age==3] <- 0.2
cmps$age[cmps$S5_Age==4] <- 0.4
cmps$age[cmps$S5_Age==5] <- 0.6
cmps$age[cmps$S5_Age==6] <- 0.8
cmps$age[cmps$S5_Age==7] <- 1
table(cmps$age)

table(cmps$S7)
cmps$foreignborn <- NA
cmps$foreignborn <- as.numeric(cmps$foreignborn)
cmps$foreignborn <- ifelse(cmps$S7==2|cmps$S7==3,1,0)
table(cmps$foreignborn)

table(cmps$S8)
cmps$pi <- NA
cmps$pi <- as.numeric(cmps$pi)
cmps$pi <- ifelse(cmps$S8==15,1,0)
table(cmps$pi)

cmps$asian.not.pi <- NA
cmps$asian.not.pi <- as.numeric(cmps$asian.not.pi)
cmps$asian.not.pi <- ifelse(cmps$pi==0,1,0)
table(cmps$asian.not.pi)

table(cmps$S8)
cmps$chinese <- NA
cmps$chinese <- as.numeric(cmps$chinese)
cmps$chinese <- ifelse(cmps$S8==1,1,0)
table(cmps$chinese)

cmps$indian <- NA
cmps$indian <- as.numeric(cmps$indian)
cmps$indian <- ifelse(cmps$S8==3,1,0)
table(cmps$indian)

cmps$filipino <- NA
cmps$filipino <- as.numeric(cmps$filipino)
cmps$filipino <- ifelse(cmps$S8==4,1,0)
table(cmps$filipino)

cmps$korean <- NA
cmps$korean <- as.numeric(cmps$korean)
cmps$korean <- ifelse(cmps$S8==5,1,0)
table(cmps$korean)

cmps$vietnamese <- NA
cmps$vietnamese <- as.numeric(cmps$vietnamese)
cmps$vietnamese <- ifelse(cmps$S8==6,1,0)
table(cmps$vietnamese)

cmps$japanese <- NA
cmps$japanese <- as.numeric(cmps$japanese)
cmps$japanese <- ifelse(cmps$S8==7,1,0)
table(cmps$japanese)

cmps$other <- NA
cmps$other <- as.numeric(cmps$other)
cmps$other <- ifelse(cmps$S8==2|cmps$S8==8|
                       cmps$S8==9|cmps$S8==10|
                       cmps$S8==11|cmps$S8==12|
                       cmps$S8==13|cmps$S8==14|
                       cmps$S8==15|cmps$S8==16,1,0)
table(cmps$other)

table(cmps$S13)
cmps$education <- NA
cmps$education <- as.numeric(cmps$education)
cmps$education[cmps$S13==1] <- 0
cmps$education[cmps$S13==2] <- 0.167
cmps$education[cmps$S13==3] <- 0.333
cmps$education[cmps$S13==4] <- 0.5
cmps$education[cmps$S13==5] <- 0.667
cmps$education[cmps$S13==6] <- 0.833
cmps$education[cmps$S13==7] <- 1
table(cmps$education)

table(cmps$Q813)
cmps$income <- NA
cmps$income <- as.numeric(cmps$income)
cmps$income[cmps$Q813==1] <- 0
cmps$income[cmps$Q813==2] <- 0.091
cmps$income[cmps$Q813==3] <- 0.182
cmps$income[cmps$Q813==4] <- 0.273
cmps$income[cmps$Q813==5] <- 0.364
cmps$income[cmps$Q813==6] <- 0.455
cmps$income[cmps$Q813==7] <- 0.545
cmps$income[cmps$Q813==8] <- 0.636
cmps$income[cmps$Q813==9] <- 0.727
cmps$income[cmps$Q813==10] <- 0.818
cmps$income[cmps$Q813==11] <- 0.909
cmps$income[cmps$Q813==12] <- 1
cmps$income[cmps$Q813==99] <- NA
table(cmps$income)  

cmps$religious.attendance <- NA
cmps$religious.attendance <- as.numeric(cmps$religious.attendance)
cmps$religious.attendance[cmps$Q59==1] <- 1
cmps$religious.attendance[cmps$Q59==2] <- 0.8
cmps$religious.attendance[cmps$Q59==3] <- 0.6
cmps$religious.attendance[cmps$Q59==4] <- 0.4
cmps$religious.attendance[cmps$Q59==5] <- 0.2
cmps$religious.attendance[cmps$Q59==6] <- 0
table(cmps$religious.attendance)

cmps$democrat <- NA
cmps$democrat <- as.numeric(cmps$democrat)
cmps$democrat[cmps$Q21==1&cmps$Q22==1] <- 0 #strong rep
cmps$democrat[cmps$Q21==2&cmps$Q22==1] <- 1 #strong dem
cmps$democrat[cmps$Q21==1&cmps$Q22==2] <- 0 #weak rep
cmps$democrat[cmps$Q21==2&cmps$Q22==2] <- 1 #weak dem
cmps$democrat[cmps$Q21==3&cmps$Q23==1] <- 0 #lean rep
cmps$democrat[cmps$Q21==3&cmps$Q23==2] <- 1 #lean dem
cmps$democrat[cmps$Q21==4&cmps$Q23==1] <- 0 #other rep
cmps$democrat[cmps$Q21==4&cmps$Q23==2] <- 1 #other dem
cmps$democrat[cmps$Q21==3&cmps$Q23==3] <- 0 #pure independent
table(cmps$democrat)

cmps$republican <- NA
cmps$republican <- as.numeric(cmps$republican)
cmps$republican[cmps$Q21==1&cmps$Q22==1] <- 1 #strong rep
cmps$republican[cmps$Q21==2&cmps$Q22==1] <- 0 #strong dem
cmps$republican[cmps$Q21==3&cmps$Q23==1] <- 1 #lean rep
cmps$republican[cmps$Q21==3&cmps$Q23==2] <- 0 #lean dem
cmps$republican[cmps$Q21==4&cmps$Q23==1] <- 1 #other rep
cmps$republican[cmps$Q21==4&cmps$Q23==2] <- 0 #other dem
cmps$republican[cmps$Q21==1&cmps$Q22==2] <- 1 #weak rep
cmps$republican[cmps$Q21==2&cmps$Q22==2] <- 0 #weak dem
cmps$republican[cmps$Q21==3&cmps$Q23==3] <- 0 #pure independent
table(cmps$republican)

cmps$independent <- NA
cmps$independent <- as.numeric(cmps$independent)
cmps$independent[cmps$Q21==1&cmps$Q22==1] <- 0 #strong rep
cmps$independent[cmps$Q21==2&cmps$Q22==1] <- 0 #strong dem
cmps$independent[cmps$Q21==3&cmps$Q23==1] <- 0 #lean rep
cmps$independent[cmps$Q21==3&cmps$Q23==2] <- 0 #lean dem
cmps$independent[cmps$Q21==4&cmps$Q23==1] <- 0 #other rep
cmps$independent[cmps$Q21==4&cmps$Q23==2] <- 0 #other dem
cmps$independent[cmps$Q21==1&cmps$Q22==2] <- 0 #weak rep
cmps$independent[cmps$Q21==2&cmps$Q22==2] <- 0 #weak dem
cmps$independent[cmps$Q21==3&cmps$Q23==3] <- 1 #pure independent
table(cmps$independent)

cmps$partystrength <- NA
cmps$partystrength <- as.numeric(cmps$partystrength)
cmps$partystrength[cmps$Q21==1&cmps$Q22==1] <- 1 #strong rep
cmps$partystrength[cmps$Q21==2&cmps$Q22==1] <- 1  #strong dem
cmps$partystrength[cmps$Q21==3&cmps$Q23==1] <- 0.5 #lean rep
cmps$partystrength[cmps$Q21==3&cmps$Q23==2] <- 0.5   #lean dem
cmps$partystrength[cmps$Q21==4&cmps$Q23==1] <- 0.25 #other rep
cmps$partystrength[cmps$Q21==4&cmps$Q23==2] <- 0.25  #other dem
cmps$partystrength[cmps$Q21==1&cmps$Q22==2] <- 0.75  #weak rep
cmps$partystrength[cmps$Q21==2&cmps$Q22==2] <- 0.75  #weak dem
cmps$partystrength[cmps$Q21==3&cmps$Q23==3] <- 0 #pure independent
table(cmps$partystrength)

cmps$interest <- NA
cmps$interest <- as.numeric(cmps$interest)
cmps$interest[cmps$Q29==1] <- 1
cmps$interest[cmps$Q29==2] <- 0.667
cmps$interest[cmps$Q29==3] <- 0.333
cmps$interest[cmps$Q29==4] <- 0
table(cmps$interest)

cmps$recruitment <- NA
cmps$recruitment <- as.numeric(cmps$recruitment)
cmps$recruitment <- ifelse(cmps$Q38r4==0,1,0)
table(cmps$recruitment)

cmps$liberal <- NA
cmps$liberal <- as.numeric(cmps$liberal)
cmps$liberal[cmps$Q43==1] <- 1
cmps$liberal[cmps$Q43==2] <- 1
cmps$liberal[cmps$Q43==3] <- 0
cmps$liberal[cmps$Q43==4] <- 0
cmps$liberal[cmps$Q43==5] <- 0
cmps$liberal[cmps$Q43==6] <- 0
table(cmps$liberal)

cmps$moderate <- NA
cmps$moderate <- as.numeric(cmps$moderate)
cmps$moderate[cmps$Q43==1] <- 0
cmps$moderate[cmps$Q43==2] <- 0
cmps$moderate[cmps$Q43==3] <- 1
cmps$moderate[cmps$Q43==4] <- 0
cmps$moderate[cmps$Q43==5] <- 0
cmps$moderate[cmps$Q43==6] <- 0
table(cmps$moderate)

cmps$conservative <- NA
cmps$conservative <- as.numeric(cmps$conservative)
cmps$conservative[cmps$Q43==1] <- 0
cmps$conservative[cmps$Q43==2] <- 0
cmps$conservative[cmps$Q43==3] <- 0
cmps$conservative[cmps$Q43==4] <- 1
cmps$conservative[cmps$Q43==5] <- 1
cmps$conservative[cmps$Q43==6] <- 0
table(cmps$conservative)

cmps$none <- NA
cmps$none <- as.numeric(cmps$none)
cmps$none[cmps$Q43==1] <- 0
cmps$none[cmps$Q43==2] <- 0
cmps$none[cmps$Q43==3] <- 0
cmps$none[cmps$Q43==4] <- 0
cmps$none[cmps$Q43==5] <- 0
cmps$none[cmps$Q43==6] <- 1
table(cmps$none)

cmps$linkedfate.asian <- NA
cmps$linkedfate.asian <- as.numeric(cmps$linkedfate.asian)
cmps$linkedfate.asian[cmps$Q551_Q559r5==1] <- 0
cmps$linkedfate.asian[cmps$Q551_Q559r5==2] <- 0.25
cmps$linkedfate.asian[cmps$Q551_Q559r5==3] <- 0.5
cmps$linkedfate.asian[cmps$Q551_Q559r5==4] <- 0.75
cmps$linkedfate.asian[cmps$Q551_Q559r5==5] <- 1
table(cmps$linkedfate.asian)

cmps$discrimination.perceived <- NA
cmps$discrimination.perceived <- as.numeric(cmps$discrimination.perceived)
cmps$discrimination.perceived[cmps$Q619_Q626r3==1] <- 1
cmps$discrimination.perceived[cmps$Q619_Q626r3==2] <- 0.667
cmps$discrimination.perceived[cmps$Q619_Q626r3==3] <- 0.333
cmps$discrimination.perceived[cmps$Q619_Q626r3==4] <- 0
cmps$discrimination.perceived[cmps$Q619_Q626r3==5] <- NA
table(cmps$discrimination.perceived)

table(cmps$Q627)
cmps$discrimination.experienced <- NA
cmps$discrimination.experienced <- as.numeric(cmps$discrimination.experienced)
cmps$discrimination.experienced <- ifelse(cmps$Q627==1,1,0)
table(cmps$discrimination.experienced)

table(cmps$Q629r1) 
cmps$discrimination.experienced.re <- NA
cmps$discrimination.experienced.re <- as.numeric(cmps$discrimination.experienced.re) 
cmps$discrimination.experienced.re[cmps$discrimination.experienced==0] <- 0
cmps$discrimination.experienced.re[cmps$Q629r1==1] <- 1
cmps$discrimination.experienced.re[cmps$Q629r1==0] <- 0
table(cmps$discrimination.experienced.re)

cmps$covid.lostjob <- NA
cmps$covid.lostjob <- as.numeric(cmps$covid.lostjob)
cmps$covid.lostjob <- ifelse(cmps$Q754_Q762r1c1==1,1,0)
table(cmps$covid.lostjob)

cmps$covid.hourscut <- NA
cmps$covid.hourscut <- as.numeric(cmps$covid.hourscut)
cmps$covid.hourscut <- ifelse(cmps$Q754_Q762r2c1==1,1,0)
table(cmps$covid.hourscut)

cmps$covid.business <- NA
cmps$covid.business <- as.numeric(cmps$covid.business)
cmps$covid.business <- ifelse(cmps$Q754_Q762r3c1==1,1,0)
table(cmps$covid.business)

cmps$covid.unemployed <- NA
cmps$covid.unemployed <- as.numeric(cmps$covid.unemployed)
cmps$covid.unemployed <- ifelse(cmps$Q754_Q762r4c1==1,1,0)
table(cmps$covid.unemployed)

cmps$covid.econ <- NA
cmps$covid.econ <- as.numeric(cmps$covid.econ)
cmps$covid.econ <- ifelse(cmps$covid.lostjob==1|
                            cmps$covid.hourscut==1|
                            cmps$covid.business==1|
                            cmps$covid.unemployed==1,1,0)
table(cmps$covid.econ)

cmps$covid.health <- NA
cmps$covid.health <- as.numeric(cmps$covid.health)
cmps$covid.health <- ifelse(cmps$Q751r1==1,1,0)

cmps$registered <- NA
cmps$registered <- as.numeric(cmps$registered)
cmps$registered[cmps$S6==1] <- 1
cmps$registered[cmps$S6==2] <- 0
cmps$registered[cmps$S6==3] <- NA
table(cmps$registered)

cmps$turnout <- NA
cmps$turnout <- as.numeric(cmps$turnout)
cmps$turnout[cmps$Q12==1] <- 1
cmps$turnout[cmps$Q12==2] <- 1
cmps$turnout[cmps$Q12==3] <- 0
cmps$turnout[cmps$Q12==4] <- 0
cmps$turnout[cmps$registered==0] <- 0
table(cmps$turnout) 

table(cmps$Q14)
cmps$biden <- NA
cmps$biden <- as.numeric(cmps$biden)
cmps$biden <- ifelse(cmps$Q14==2,1,0)
table(cmps$biden)

cmps$citizen <- NA
cmps$citizen <- as.numeric(cmps$citizen)
cmps$citizen[cmps$S7==1] <- 1
cmps$citizen[cmps$Q807==1] <- 1
cmps$citizen[cmps$Q807==2] <- 0
cmps$citizen[cmps$Q807==3] <- 0
cmps$citizen[cmps$Q807==4] <- 0
cmps$citizen[cmps$Q807==5] <- 0
cmps$citizen[cmps$Q807==6] <- 0
cmps$citizen[cmps$Q807==7] <- 0
cmps$citizen[cmps$Q807==8] <- 0
table(cmps$Q807)
table(cmps$citizen)

table(cmps$Q2r4)
cmps$harris <- NA
cmps$harris[cmps$Q2r4==1] <- 1
cmps$harris[cmps$Q2r4==2] <- 0.75
cmps$harris[cmps$Q2r4==5] <- 0.5
cmps$harris[cmps$Q2r4==6] <- 0.5
cmps$harris[cmps$Q2r4==3] <- 0.25
cmps$harris[cmps$Q2r4==4] <- 0
table(cmps$harris)

## SUBSET BY RACIAL/ETHNIC GROUPS (NATIONAL ORIGIN)

#Analysis for Asian Americans does not include Pacific Islanders
asian <- subset(cmps, subset=(asian.not.pi==1)) #n=3,928

#Asian American citizen sample: use for turnout analysis (all asians)
asian.citizen <- subset(asian, subset=(citizen==1)) #n=3,372

#Asian American citizen+turned out to vote: use for vote choice analysis (all asians)
asian.citizen.turnout <- subset(asian.citizen, subset=(turnout==1)) #n=2,502

#Asian American foreign born
asian.foreign <- subset(asian, subset=(foreignborn==1)) #n=1,794

#Asian American foreign born + citizens only
asian.foreign.citizen <- subset(asian.foreign, subset=(citizen==1)) #n=1,238

#Asian Ameriacn foreign born + citzen + turned out to vote
asian.foreign.citizen.turnout <- subset(asian.foreign.citizen, subset=(turnout==1)) #n=976

#Asian American native born
asian.native <- subset(asian, subset=(foreignborn==0)) #n=2,134

#Asian American native born (citizen) // verified this is the same sample as asian.native
asian.native.citizen <- subset(asian.native, subset=(citizen==1)) #n=2,134

#Asian American native born (citizen) + turned out to vote
asian.native.citizen.turnout <- subset(asian.native.citizen, subset=(turnout==1)) #1,526


#SUBSET BY NATIONAL ORIGIN
#chinese all
chinese <- subset(cmps, subset=(chinese==1)) #n=973

#use for turnout all chinese
chinese.citizen <- subset(chinese, subset=(citizen==1)) #n=931

#use for vote choice all chinese
chinese.citizen.turnout <- subset(chinese.citizen, subset=(turnout==1)) #n=770

#use for turnout all chinese democrats
chinese.citizen.democrat <- subset(chinese.citizen, subset=(democrat==1)) #n=515

#use for vote choice
chinese.citizen.turnout.democrat <- subset(chinese.citizen.turnout, subset=(democrat==1)) #n=435

#vietnamese all
vietnamese <- subset(cmps, subset=(vietnamese==1)) #n=370

#use for turnout all vietnamese
vietnamese.citizen <- subset(vietnamese, subset=(citizen==1)) #n=339

#use for vote choice all vietnamese
vietnamese.citizen.turnout <- subset(vietnamese.citizen, subset=(turnout==1)) #n=185

#use for turnout all vietnamese democrats
vietnamese.citizen.democrat <- subset(vietnamese.citizen, subset=(democrat==1)) #n=185

#use for turnout all vietnamese republicans
vietnamese.citizen.republican <- subset(vietnamese.citizen, subset=(republican==1)) #n=77

#korean all
korean <- subset(cmps, subset=(korean==1)) #n=392

#use for turnout all korean
korean.citizen <- subset(korean, subset=(citizen==1)) #n=348

#use for vote choice all korean
korean.citizen.turnout <- subset(korean.citizen, subset=(turnout==1)) #n=219

#use for turnout all korean democrats
korean.citizen.democrat <- subset(korean.citizen, subset=(democrat==1)) #n=202

#indian all
indian <- subset(cmps, subset=(indian==1)) #n=722

#use for turnout all indian
indian.citizen <- subset(indian, subset=(citizen==1)) #n=517

#use for vote choice all indian
indian.citizen.turnout <- subset(indian.citizen, subset=(turnout==1)) #n=398

#use for turnout all indian democrat
indian.citizen.democrat <- subset(indian.citizen, subset=(democrat==1)) #n=341

#japanese all
japanese <- subset(cmps, subset=(japanese==1)) #n=507

#use for turnout all japanese
japanese.citizen <- subset(japanese, subset=(citizen==1)) #n=457

#use for vote choice japanese
japanese.citizen.turnout <- subset(japanese.citizen, subset=(turnout==1)) #n=401

#use for turnout for all japanese democrat
japanese.citizen.democrat <- subset(japanese.citizen, subset=(democrat==1)) #n=283


#filipino all
filipino <- subset(cmps, subset=(filipino==1)) #427

#use for turnout all filipino
filipino.citizen <- subset(filipino, subset=(citizen==1)) #320

#use for vote choice all filipino
filipino.citizen.turnout <- subset(filipino.citizen, subset=(turnout==1)) #220

#use for turnout all filipino democrat
filipino.citizen.democrat <- subset(filipino.citizen, subset=(democrat==1)) #n=165

#use for turnout all filipino republican
filipino.citizen.republican <- subset(filipino.citizen, subset=(republican==1)) #n=92

#asian american democrat
asian.democrat <- subset(asian,(democrat==1)) #2267

#use for turnout all democrat
asian.citizen.democrat <- subset(asian.democrat, subset=(citizen==1)) #1949


#FIGURE 1: VOTER TURNOUT RATES
weighted.mean(asian.citizen$turnout, asian.citizen$weight, na.rm=TRUE) #67.6; n=3,372
weighted.mean(asian.foreign.citizen$turnout, asian.foreign.citizen$weight, na.rm=TRUE) #72.4; n=1,238
weighted.mean(asian.native.citizen$turnout, asian.native.citizen$weight, na.rm=TRUE) #60.7; n=2,134
weighted.mean(chinese.citizen$turnout, chinese.citizen$weight, na.rm=TRUE) #79.4; n=931
weighted.mean(filipino.citizen$turnout, filipino.citizen$weight, na.rm=TRUE) #58.3; n=320
weighted.mean(indian.citizen$turnout, indian.citizen$weight, na.rm=TRUE) #74; n=517
weighted.mean(japanese.citizen$turnout, japanese.citizen$weight, na.rm=TRUE) #83.3; n=457
weighted.mean(korean.citizen$turnout, korean.citizen$weight, na.rm=TRUE) #60.1; n=348
weighted.mean(vietnamese.citizen$turnout, vietnamese.citizen$weight, na.rm=TRUE) #52.5; n=339

##TABLE 1: PREDICTORS OF TURNOUT (All Asian Americans)

#Model 1 Coefficients
mod1a <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other, family='binomial',
             data=asian.citizen, weights = asian.citizen$weight)
summary(mod1a)
#Model 1 Odds Ratios
(exp(mod1a$coefficients[-1]))

#Model 2 Coefficients
mod2a <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=asian.citizen, weights = asian.citizen$weight)
summary(mod2a)
#Model 2 Odds Ratios
(exp(mod2a$coefficients[-1]))

###TABLE 2: PREDICTORS OF TURNOUT BY IMMIGRATION STATUS FOR FOREIGN BORN VS. NATIVE BORN; ALSO FIGURE B1 AND B2
#DATA ALSO FOR FIGURE 2 and B1 (Foreign-orn Asian Americans Only)

#Foreign born
mod2b <- glm(turnout~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=asian.foreign.citizen, weights = asian.foreign.citizen$weight)
summary(mod2b)
get_model_data(mod2b, type="eff") 
(exp(mod2b$coefficients[-1]))

#Native Born
mod2c <- glm(turnout~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=asian.native.citizen, weights = asian.native.citizen$weight)
summary(mod2c)
get_model_data(mod2c, type="eff")
(exp(mod2c$coefficients[-1]))

#FIGURE 3: Vote Choice
weighted.mean(asian.citizen.turnout$biden, asian.citizen.turnout$weight, na.rm=TRUE) #69.6; n=2,502
weighted.mean(asian.foreign.citizen.turnout$biden, asian.foreign.citizen.turnout$weight, na.rm=TRUE) #67.1; n=976
weighted.mean(asian.native.citizen.turnout$biden, asian.native.citizen.turnout$weight, na.rm=TRUE) #73.9; n=1,526
weighted.mean(chinese.citizen.turnout$biden, chinese.citizen.turnout$weight, na.rm=TRUE) #69.2; n=770
weighted.mean(filipino.citizen.turnout$biden, filipino.citizen.turnout$weight, na.rm=TRUE) #63.8; n=220
weighted.mean(indian.citizen.turnout$biden, indian.citizen.turnout$weight, na.rm=TRUE) #75.9; n=398
weighted.mean(japanese.citizen.turnout$biden, japanese.citizen.turnout$weight, na.rm=TRUE)#71.2; n=401
weighted.mean(korean.citizen.turnout$biden, korean.citizen.turnout$weight, na.rm=TRUE) #72.6; n=219
weighted.mean(vietnamese.citizen.turnout$biden, vietnamese.citizen.turnout$weight, na.rm=TRUE) #59.7; n=185

### TABLE 3: PREDICTORS OF VOTE CHOICE (All Asian Americans); TABLE B11 Also

#Model 1
mod3a <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other,
             data=asian.citizen.turnout,family='binomial',
             weight=asian.citizen.turnout$weight)
summary(mod3a)
(exp(mod3a$coefficients[-1]))

#Model 2
mod4a <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=asian.citizen.turnout,family='binomial',
             weight=asian.citizen.turnout$weight)
summary(mod4a)
(exp(mod4a$coefficients[-1]))

## TABLE 4: PREDICTORS OF VOTE CHOICE BY IMMIGRATION STATUS FOR FOREIGN BORN VS. NATIVE BORN; ALSO FIGURE B3
#DATA FOR FIGURE 4 and B2 ALSO

#Foreign Born
mod4b <- glm(biden~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=asian.foreign.citizen.turnout,family='binomial',
             weight=asian.foreign.citizen.turnout$weight)
summary(mod4b)
get_model_data(mod4b, type="eff")
(exp(mod4b$coefficients[-1]))

#Native Born
mod4c <- glm(biden~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=asian.native.citizen.turnout,family='binomial',
             weight=asian.native.citizen.turnout$weight)

summary(mod4c)
(exp(mod4c$coefficients[-1]))

#Table 5 and B9: By National Origin

#chinese
mod6d <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=chinese.citizen.turnout,family='binomial',
             weights=chinese.citizen.turnout$weight)
summary(mod6d)
(exp(mod6d$coefficients[-1]))
get_model_data(mod6d, type="eff")

#filipino
mod6h <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=filipino.citizen.turnout,family='binomial',
             weights=filipino.citizen.turnout$weight)
summary(mod6h)
(exp(mod6h$coefficients[-1]))
get_model_data(mod6h, type="eff")

#indian
mod6i <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=indian.citizen.turnout,family='binomial',
             weights=indian.citizen.turnout$weight)
summary(mod6i)
(exp(mod6h$coefficients[-1]))
get_model_data(mod6i, type="eff")

#japanese
mod6f <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=japanese.citizen.turnout,family='binomial',
             weights=japanese.citizen.turnout$weight)
summary(mod6f)
(exp(mod6f$coefficients[-1]))
get_model_data(mod6f,type="eff")

#korean
mod6e <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=korean.citizen.turnout,family='binomial',
             weights=korean.citizen.turnout$weight)
summary(mod6e)
(exp(mod6e$coefficients[-1]))
get_model_data(mod6e, type="eff")

#vietnamese
mod6g <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re,
             data=vietnamese.citizen.turnout,family='binomial',
             weights=vietnamese.citizen.turnout$weight)
summary(mod6g)
(exp(mod6g$coefficients[-1]))
get_model_data(mod6g, type="eff")


###APPENDIX ANALYSIS: 

#TABLE B1

#All Asian Americans
mod5a <- glm(turnout~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ+foreignborn, family='binomial',
             data=asian.citizen, weights = asian.citizen$weight)
summary(mod5a)

#foreign born
mod5b <- glm(turnout~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=asian.foreign.citizen, weights = asian.foreign.citizen$weight)
summary(mod5b)

#native born
mod5c <- glm(turnout~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=asian.native.citizen, weights = asian.native.citizen$weight)
summary(mod5c)

## TABLE B2

#Chinese
mod5d <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ
             , family='binomial',
             data=chinese.citizen, weights = chinese.citizen$weight)
summary(mod5d)

#Filipino
mod5h <- glm(turnout~age+woman+education+income+
               foreignborn+religious.attendance+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=filipino.citizen, weights = filipino.citizen$weight)
summary(mod5h)

#Indian
mod5i <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=indian.citizen, weights = indian.citizen$weight)
summary(mod5i)

#Japanese
mod5f <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=japanese.citizen, weights = japanese.citizen$weight)
summary(mod5f)

#Korean
mod5e <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=korean.citizen, weights = korean.citizen$weight)
summary(mod5e)

#Vietnamese
mod5g <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               recruitment+
               interest+partystrength+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ, family='binomial',
             data=vietnamese.citizen, weights = vietnamese.citizen$weight)
summary(mod5g)

## TABLE B3

#All Asian Americans
mod6a <- glm(biden~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ+foreignborn,
             data=asian.citizen.turnout,family='binomial',
             weight=asian.citizen.turnout$weight)
summary(mod6a)

#foreign born
mod6b <- glm(biden~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=asian.foreign.citizen.turnout,family='binomial',
             weight=asian.foreign.citizen.turnout$weight)
summary(mod6b)

#native born
mod6c <- glm(biden~age+woman+education+income+religious.attendance+
               chinese+filipino+japanese+korean+vietnamese+other+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=asian.native.citizen.turnout,family='binomial',
             weight=asian.native.citizen.turnout$weight)
summary(mod6c)

##Table B4

#chinese
mod7a <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=chinese.citizen.turnout,family='binomial',
             weights=chinese.citizen.turnout$weight)
summary(mod7a)

#filipino
mod7b <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=filipino.citizen.turnout,family='binomial',
             weights=filipino.citizen.turnout$weight)
summary(mod7b)

#indian
mod7c <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=indian.citizen.turnout,family='binomial',
             weights=indian.citizen.turnout$weight)
summary(mod7c)

#japanese
mod7d <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=japanese.citizen.turnout,family='binomial',
             weights=japanese.citizen.turnout$weight)
summary(mod7d)

#korean
mod7e <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=korean.citizen.turnout,family='binomial',
             weights=korean.citizen.turnout$weight)
summary(mod7e)

#vietnamese
mod7f <- glm(biden~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re+
               covid.health+covid.econ,
             data=vietnamese.citizen.turnout,family='binomial',
             weights=vietnamese.citizen.turnout$weight)
summary(mod7f)

## Table B5

#foreign born
mod10a <- glm(turnout~age+woman+education+income+religious.attendance+
                chinese+filipino+japanese+korean+vietnamese+other, family='binomial',
              data=asian.foreign.citizen, weights = asian.foreign.citizen$weight)
summary(mod10a)
(exp(mod10a$coefficients[-1]))

#native born
mod10b <- glm(turnout~age+woman+education+income+religious.attendance+
                chinese+filipino+japanese+korean+vietnamese+other, family='binomial',
              data=asian.native.citizen, weights = asian.native.citizen$weight)
summary(mod10b)
(exp(mod10b$coefficients[-1]))

#Table B6

#Chinese
mod8a <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=chinese.citizen, weights = chinese.citizen$weight)
summary(mod8a)

#Filipino
mod8b <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=filipino.citizen, weights = filipino.citizen$weight)
summary(mod8b)

#Indian
mod8c <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=indian.citizen, weights = indian.citizen$weight)
summary(mod8c)

#Japanese
mod8d <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=japanese.citizen, weights = japanese.citizen$weight)
summary(mod8d)

#Korean
mod8e <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=korean.citizen, weights = korean.citizen$weight)
summary(mod8e)

#Vietnamese
mod8f <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=vietnamese.citizen, weights = vietnamese.citizen$weight)
summary(mod8f)

#Table B7

#Chinese
mod8a <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re
             
             , family='binomial',
             data=chinese.citizen, weights = chinese.citizen$weight)
summary(mod8a)

#Filipino
mod8b <- glm(turnout~age+woman+education+income+
               foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=filipino.citizen, weights = filipino.citizen$weight)
summary(mod8b)

#Indian
mod8c <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=indian.citizen, weights = indian.citizen$weight)
summary(mod8c)

#Japanese
mod8d <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=japanese.citizen, weights = japanese.citizen$weight)
summary(mod8d)

#Korean
mod8e <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=korean.citizen, weights = korean.citizen$weight)
summary(mod8e)

#Vietnamese
mod8f <- glm(turnout~age+woman+education+income+foreignborn+religious.attendance+
               interest+republican+independent+
               linkedfate.asian+discrimination.perceived+discrimination.experienced.re, family='binomial',
             data=vietnamese.citizen, weights = vietnamese.citizen$weight)
summary(mod8f)

#Table B8

#Foreign Born
mod14a <- glm(biden~age+woman+education+income+religious.attendance+
                chinese+filipino+japanese+korean+vietnamese+other,
              data=asian.foreign.citizen.turnout,family='binomial',
              weight=asian.foreign.citizen.turnout$weight)
summary(mod14a)
(exp(mod14a$coefficients[-1]))


#Native Born
mod14b <- glm(biden~age+woman+education+income+religious.attendance+
                chinese+filipino+japanese+korean+vietnamese+other,
              data=asian.native.citizen.turnout,family='binomial',
              weight=asian.native.citizen.turnout$weight)
summary(mod14b)
(exp(mod14b$coefficients[-1]))

#Table B10

#Chinese
mod9a <- glm(biden~age+woman+education+income+foreignborn+religious.attendance
             , family='binomial',
             data=chinese.citizen, weights = chinese.citizen$weight)
summary(mod9a)

#Filipino
mod9b <- glm(biden~age+woman+education+income+
               foreignborn+religious.attendance, family='binomial',
             data=filipino.citizen, weights = filipino.citizen$weight)
summary(mod9b)

#Indian
mod9c <- glm(biden~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=indian.citizen, weights = indian.citizen$weight)
summary(mod9c)

#Japanese
mod9d <- glm(biden~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=japanese.citizen, weights = japanese.citizen$weight)
summary(mod9d)

#Korean
mod9e <- glm(biden~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=korean.citizen, weights = korean.citizen$weight)
summary(mod9e)

#Vietnamese
mod9f <- glm(biden~age+woman+education+income+foreignborn+religious.attendance, family='binomial',
             data=vietnamese.citizen, weights = vietnamese.citizen$weight)
summary(mod9f)

#Table B11

#Descriptive Data - Recruitment
weighted.mean(asian.citizen$recruitment, asian.citizen$weight, na.rm=TRUE) #48; n=3,372
weighted.mean(japanese.citizen$recruitment, japanese.citizen$weight, na.rm=TRUE) #46; n=457
weighted.mean(chinese.citizen$recruitment, chinese.citizen$weight, na.rm=TRUE) #44; n=931
weighted.mean(indian.citizen$recruitment, indian.citizen$weight, na.rm=TRUE) #58; n=517
weighted.mean(korean.citizen$recruitment, korean.citizen$weight, na.rm=TRUE) #49; n=348
weighted.mean(filipino.citizen$recruitment, filipino.citizen$weight, na.rm=TRUE) #46; n=320
weighted.mean(asian.foreign.citizen$recruitment, asian.foreign.citizen$weight, na.rm=TRUE)
weighted.mean(asian.native.citizen$recruitment, asian.native.citizen$weight, na.rm=TRUE)